package enterprise.manage.dao.sp;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.SqlOutParameter;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.StoredProcedure;

import javax.sql.DataSource;
import java.sql.Types;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: panxuanang
 * Date: 2010-11-19
 * Time: 11:19:51
 * Desc:
 */
public class GetSysNoProcedure extends StoredProcedure {

    /**
     * 构造函数
     *
     * @param dataSource 数据源
     * @param spName     存储过程
     */
    public GetSysNoProcedure(DataSource dataSource, String spName) {
        super(dataSource, spName);
        //定义输入变量
        declareParameter(new SqlParameter("type", Types.VARCHAR)); 
        //定义输出变量
        declareParameter(new SqlOutParameter("no", Types.VARCHAR));
        this.compile();
    }

    /**
     * 执行存储过程
     *
     * @param map map
     * @return 返回值
     * @throws DataAccessException 异常
     */
    public Map execute(Map map) throws DataAccessException {
        return super.execute(map);
    }
}